home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / biged.zip / BEMAIN.PAS < prev    next >
Pascal/Delphi Source File  |  1990-12-11  |  17KB  |  651 lines

  1. {$F+,O+,A+,B-,D-,E+,I-,L-,N-,R-,S-,V-}
  2.  
  3. unit BEMain;
  4.  
  5. {$I OPDEFINE.INC}
  6.  
  7. interface
  8.  
  9. uses
  10.   Dos,
  11.   OpInline,
  12.   OpRoot,
  13.   OpCrt,
  14.   OpDos,
  15.   OpString,
  16. {$IFDEF UseMouse}
  17.   OpMouse,
  18. {$ENDIF}
  19.   OpCmd,
  20. {$IFDEF UseDrag}
  21.   OpDrag,
  22. {$ENDIF}
  23.   OpFrame,
  24.   OpWindow,
  25.   OpEdit,
  26.   BigEd,
  27.   ExecAccess;  {<-- NOTE: See OPro manual vol 3 pp 10-33 for this unit}
  28.  
  29.  
  30. procedure Main;
  31.  
  32. implementation
  33.  
  34. const
  35.     {NOTE: These *MUST* be full path\filename with extension!}
  36.   TPC_Command  : PathStr = 'C:\TP\TPC.EXE';
  37.   SwapFilePath : PathStr = 'C:\$ED1$.SWP';
  38.  
  39. const
  40.   TTColors : ColorSet = (
  41.     TextColor       : $1B; TextMono       : $0F;
  42.     CtrlColor       : $1C; CtrlMono       : $07;
  43.     FrameColor      : $13; FrameMono      : $07;
  44.     HeaderColor     : $20; HeaderMono     : $70;
  45.     ShadowColor     : $08; ShadowMono     : $70;
  46.     HighlightColor  : $1E; HighlightMono  : $70;
  47.     PromptColor     : $0E; PromptMono     : $07;
  48.     SelPromptColor  : $0E; SelPromptMono  : $07;
  49.     ProPromptColor  : $30; ProPromptMono  : $07;
  50.     FieldColor      : $0F; FieldMono      : $0F;
  51.     SelFieldColor   : $0F; SelFieldMono   : $0F;
  52.     ProFieldColor   : $17; ProFieldMono   : $07;
  53.     ScrollBarColor  : $13; ScrollBarMono  : $07;
  54.     SliderColor     : $30; SliderMono     : $0F;
  55.     HotSpotColor    : $30; HotSpotMono    : $70;
  56.     BlockColor      : $30; BlockMono      : $0F;
  57.     MarkerColor     : $4F; MarkerMono     : $70;
  58.     DelimColor      : $31; DelimMono      : $0F;
  59.     SelDelimColor   : $31; SelDelimMono   : $0F;
  60.     ProDelimColor   : $31; ProDelimMono   : $0F;
  61.     SelItemColor    : $3E; SelItemMono    : $70;
  62.     ProItemColor    : $17; ProItemMono    : $07;
  63.     HighItemColor   : $1F; HighItemMono   : $0F;
  64.     AltItemColor    : $1F; AltItemMono    : $0F;
  65.     AltSelItemColor : $3F; AltSelItemMono : $70;
  66.     FlexAHelpColor  : $1F; FlexAHelpMono  : $0F;
  67.     FlexBHelpColor  : $1F; FlexBHelpMono  : $0F;
  68.     FlexCHelpColor  : $1B; FlexCHelpMono  : $70;
  69.     UnselXrefColor  : $1E; UnselXrefMono  : $09;
  70.     SelXrefColor    : $5F; SelXrefMono    : $70;
  71.     MouseColor      : $4F; MouseMono      : $70
  72.   );
  73.  
  74. type
  75.   FileNodePtr = ^FileNode;
  76.   FileNode =
  77.     Object(DoubleListNode)
  78.       Path : PathStr;
  79.       State : StreamStateRec;
  80.  
  81.       constructor Init(P : PathStr; var S : StreamStateRec);
  82.       destructor Done; virtual;
  83.       procedure Update(P : PathStr; var S : StreamStateRec);
  84.     end;
  85.  
  86. var
  87.   BE : BigEditorPtr;
  88.   BW : StackWindow;
  89.   W  : Word;
  90.   LC : Word;
  91.   CC : Word;
  92.   FilesList : DoubleList;
  93.   Report : String;
  94.   ErrFnd : Boolean;
  95.   NFName : PathStr;
  96.   CmpFile : PathStr;
  97.   State : StreamStateRec;
  98.  
  99.  
  100.   constructor FileNode.Init(P : PathStr; var S : StreamStateRec);
  101.   begin
  102.     if NOT DoubleListNode.Init then Fail;
  103.     FileNode.Update(P,S);
  104.   end;
  105.  
  106.   destructor FileNode.Done;
  107.   begin
  108.     DoubleListNode.Done;
  109.   end;
  110.  
  111.   procedure FileNode.Update(P : PathStr; var S : StreamStateRec);
  112.   begin
  113.     Path := StUpCase(P);
  114.     State := S;
  115.   end;
  116.  
  117.   function FindFileInList(PS : PathStr) : FileNodePtr;
  118.   var P : FileNodePtr;
  119.   begin
  120.     PS := StUpCase(PS);
  121.     with FilesList do begin
  122.       P := FileNodePtr(Head);
  123.       while P <> NIL do begin
  124.         if P^.Path = PS then begin
  125.           FindFileInList := P;
  126.           exit;
  127.         end;
  128.         P := FileNodePtr(Next(P));
  129.       end;
  130.       FindFileInList := NIL;
  131.     end;
  132.   end;
  133.  
  134.   procedure AddFileToList(PS : PathStr; var S : StreamStateRec);
  135.   var P : FileNodePtr;
  136.   begin
  137.     P := FindFileInList(PS);
  138.     if P = NIL then begin
  139.       New(P,Init(PS,S));
  140.       FilesList.Append(P);
  141.     end
  142.     else P^.Update(PS,S);
  143.   end;
  144.  
  145.  
  146.   procedure Status(CWP : BigEditorPtr);
  147.   const
  148.     TPath : String[12] = '            ';
  149.     DefLine : String[80] =
  150.   {          1         2         3         4         5         6         7         8 }
  151.   { 12345678901234567890123456789012345678901234567890123456789012345678901234567890 }
  152.    ' xxxxxxxx.xxx   Line: xxxxx  Col: xxxx  xxxk  Ins Ind Smart Wrap Save           ';
  153.   var
  154.     S,T : String;
  155.  
  156.     procedure Mov(L : String; I : Integer);
  157.     begin
  158.       Move(L[1],S[i],Length(L));
  159.     end;
  160.  
  161.   begin
  162.     with CWP^ do begin
  163.         {fix display path if a new file}
  164.       if LongFlagIsSet(beOptions,beNewFile) then begin
  165.         TPath := Pad(JustFileName(Path),13);
  166.         ClearLongFlag(beOptions,beNewFile);
  167.       end;
  168.  
  169.         {do nothing else if we're in a hurry}
  170.       if (LongFlagIsSet(beOptions,beFastScrUpd)) and
  171.          (cwCmdPtr^.cpKeyPressed) then exit;
  172.  
  173.       S := DefLine;
  174.       Mov(Pad(Long2Str(CurTopIdx+CurLineOfs),5),23);
  175.       Mov(Pad(Long2Str(COfs+XOfs),4),35);
  176.       Mov(LeftPad(Long2Str(MemAvail div 1024),3),41);
  177.  
  178.       if beOptionsAreOn(beInsert) then
  179.         Mov('Ins',47)
  180.       else
  181.         Mov('Ovr',47);
  182.       if NOT beOptionsAreOn(beIndent) then
  183.         Mov('   ',51);
  184.       if NOT beOptionsAreOn(beModified) then
  185.         Mov('    ',66);
  186.       if NOT beOptionsAreOn(beWordWrap) then
  187.         Mov('    ',61);
  188.       if NOT beOptionsAreOn(beSmartTabs) then
  189.         Mov('     ',55);
  190.       Mov(TPath,2);
  191.       S[0] := Chr(ScreenWidth);
  192.       with TTColors do
  193.         FastWrite(S,Pred(wYL),wXL,ColorMono(HeaderColor,HeaderMono));
  194.     end;
  195.   end;
  196.  
  197.   procedure UserHook(CPP : CommandProcessorPtr; MT : MatchType; Key : Word);
  198.     {-Called each time CommandProcessor evaluates a keystroke}
  199.   var
  200.     S : string[2];
  201.     {$IFDEF UseMouse}
  202.     SaveMouse : Boolean;
  203.     {$ENDIF}
  204.   begin
  205.     S := '  ';
  206.     if MT = PartMatch then
  207.       if Lo(Key) < Ord(' ') then begin
  208.         S[1] := '^';
  209.         S[2] := Char(Lo(Key)+$40);
  210.       end
  211.       else
  212.         S[1] := '+';
  213.  
  214.     {$IFDEF UseMouse}
  215.     HideMousePrim(SaveMouse);
  216.     {$ENDIF}
  217.  
  218.     with TTColors do
  219.       FastWrite(S, 1, 1, ColorMono(PromptColor, PromptMono));
  220.  
  221.     {$IFDEF UseMouse}
  222.     ShowMousePrim(SaveMouse);
  223.     {$ENDIF}
  224.   end;
  225.  
  226.   procedure Abort(Msg : string);
  227.     {-Display an error message and halt}
  228.   begin
  229.     {$IFDEF UseMouse}
  230.     {hide the mouse cursor}
  231.     HideMouse;
  232.     {$ENDIF}
  233.  
  234.     Window(1, 1, ScreenWidth, ScreenHeight);
  235.     TextAttr := $07;
  236.     ClrScr;
  237.     WriteLn(Msg);
  238.     Halt(1);
  239.   end;
  240.  
  241.   procedure ClearPromptLine;
  242.     {-Clear the status line}
  243.   {$IFDEF UseMouse}
  244.   var
  245.     SaveMouse : Boolean;
  246.   {$ENDIF}
  247.   begin
  248.     {$IFDEF UseMouse}
  249.     HideMousePrim(SaveMouse);
  250.     {$ENDIF}
  251.  
  252.     with TTColors do
  253.       FastWrite(CharStr(' ', ScreenWidth), 1, 1, ColorMono(PromptColor, PromptMono));
  254.  
  255.     {$IFDEF UseMouse}
  256.     ShowMousePrim(SaveMouse);
  257.     {$ENDIF}
  258.   end;
  259.  
  260.   procedure DisplayMessage(Msg : string);
  261.     {-Display a message at the top of the screen}
  262.   {$IFDEF UseMouse}
  263.   var
  264.     SaveMouse : Boolean;
  265.   {$ENDIF}
  266.   begin
  267.     {$IFDEF UseMouse}
  268.     HideMousePrim(SaveMouse);
  269.     {$ENDIF}
  270.  
  271.     ClearPromptLine;
  272.     if Length(Msg) > ScreenWidth then Msg[0] := Chr(ScreenWidth);
  273.     with TTColors do
  274.       FastWrite(Msg, 1, 1, ColorMono(PromptColor, PromptMono));
  275.  
  276.     {$IFDEF UseMouse}
  277.     ShowMousePrim(SaveMouse);
  278.     {$ENDIF}
  279.  
  280.     GotoXYabs(Length(Msg)+1, 1);
  281.   end;
  282.  
  283.   procedure ErrorProc(UnitCode : Byte; var ErrCode : Word; Msg : string);
  284.     {-Error handler}
  285.   var
  286.     I : Word;
  287.     CursorSL, CursorXY : Word;
  288.   begin
  289.     {save the cursor position and shape}
  290.     GetCursorState(CursorXY, CursorSL);
  291.  
  292.     {clear the status line}
  293.     ClearPromptLine;
  294.  
  295.     {display the error message}
  296.     NormalCursor;
  297.     DisplayMessage(' '+Msg+'. Press any key...');
  298.  
  299.     {wait for a keypress}
  300.     I := ReadKeyWord;
  301.  
  302.     {clear the prompt line}
  303.     ClearPromptLine;
  304.  
  305.     {Restore cursor position and shape}
  306.     RestoreCursorState(CursorXY, CursorSL);
  307.   end;
  308.  
  309.   function EditProc(MsgCode : Word;
  310.                     Prompt : string;
  311.                     ForceUp : Boolean;
  312.                     TrimBlanks : Boolean;
  313.                     MaxLen : Byte;
  314.                     var S : string) : Boolean;
  315.    {-Line editing routine}
  316.   var
  317.     LE : LineEditor;
  318.     Width : Byte;
  319.   begin
  320.     with LE do begin
  321.       ClearPromptLine;
  322.       Init(TTColors);
  323.       if ForceUp then
  324.         leEditOptionsOn(leForceUpper)
  325.       else
  326.         leEditOptionsOff(leForceUpper);
  327.       if TrimBlanks then
  328.         leEditOptionsOn(leTrimBlanks)
  329.       else
  330.         leEditOptionsOff(leTrimBlanks);
  331.       Prompt := ' '+Prompt;
  332.       if Length(Prompt)+MaxLen > 80 then
  333.         Width := 79-Length(Prompt)
  334.       else
  335.         Width := MaxLen;
  336.       ReadString(Prompt, 1, 1, MaxLen, Width, S);
  337.       EditProc := (GetLastCommand <> ccQuit);
  338.       ClearPromptLine;
  339.     end;
  340.   end;
  341.  
  342.   function YesNoFunc(MsgCode : Word; Prompt : string;
  343.                      Default : Byte; QuitAndAll : Boolean) : Byte;
  344.     {-Get a response to a yes-no question}
  345.   var
  346.     LE : LineEditor;
  347.     Ch : Char;
  348.     CharsToTake : CharSet;
  349.   begin
  350.     with LE do begin
  351.       ClearPromptLine;
  352.       Init(TTColors);
  353.       leEditOptionsOn(leAllowEscape+leDefaultAccepted+leForceUpper);
  354.       if Default = beYes then
  355.         Ch := 'Y'
  356.       else
  357.         Ch := 'N';
  358.       if QuitAndAll then begin
  359.         CharsToTake := ['Y', 'N', 'A', 'Q'];
  360.         Prompt := Prompt+' (Y/N/A/Q)'
  361.       end
  362.       else
  363.         CharsToTake := ['Y', 'N'];
  364.       ReadChar(Prompt, 1, 1, CharsToTake, Ch);
  365.       if GetLastCommand = ccQuit then
  366.         YesNoFunc := beQuit
  367.       else case Ch of
  368.         'Y' : YesNoFunc := beYes;
  369.         'N' : YesNoFunc := beNo;
  370.         'A' : YesNoFunc := beAll;
  371.         'Q' : YesNoFunc := beQuit;
  372.       end;
  373.       ClearPromptLine;
  374.     end;
  375.   end;
  376.  
  377.   function GetFile(MsgCode : Word; Prompt : string;
  378.                    ForceUp, TrimBlanks, Writing, MustExist : Boolean;
  379.                    MaxLen : Byte; DefExt : ExtStr;
  380.                    var S : string) : Boolean;
  381.     {-Get a filename}
  382.   var
  383.     I : Word;
  384.   begin
  385.     if not EditProc(0, Prompt, ForceUp, TrimBlanks, MaxLen, S) then
  386.       GetFile := False
  387.     else if Writing then
  388.       if ExistFile(S) then
  389.         GetFile := YesNoFunc(0, 'File exists. Overwrite it?', beNo, False) = beYes
  390.       else
  391.         GetFile := True
  392.     else if ExistFile(S) or not MustExist then
  393.       GetFile := True
  394.     else begin
  395.       I := 0;
  396.       ErrorProc(0, I, 'File not found');
  397.       GetFile := False;
  398.     end;
  399.   end;
  400.  
  401.   procedure FindCompileError;
  402.   var S,T : String;
  403.       I,N : Integer;
  404.   begin
  405.     for I := 1 to ScreenHeight do begin
  406.       FastRead(ScreenWidth,I,1,S);
  407.       if Pos('): Error',S) > 0 then begin
  408.         Report := S;
  409.         NFName := Copy(S,1,Pred(Pos('(',S)));
  410.         T := Copy(S,Pos('(',S)+1,5);
  411.         while (Length(T) > 0) and (NOT(T[length(T)] in ['0'..'9'])) do Dec(T[0]);
  412.         if Str2Word(T,LC) then begin
  413.           N := 0;  CC := I;
  414.           while CC <= ScreenHeight do begin
  415.             Inc(CC);
  416.             Inc(N);
  417.             FastRead(ScreenWidth,CC,1,S);
  418.             if Trim(S) = '^' then begin
  419.               CC := Pos('^',S) + (80 * Pred(N div 2));
  420.               exit;
  421.             end;
  422.           end;
  423.         end;
  424.       end;
  425.     end;
  426.   end;
  427.  
  428.   procedure FindCompileGood;
  429.   var S : String;
  430.       I : Integer;
  431.   begin
  432.     for I := 1 to ScreenHeight do begin
  433.       FastRead(ScreenWidth,I,1,S);
  434.       if Pos(' lines, ',S) > 0 then begin
  435.         Report := S;
  436.         exit;
  437.       end;
  438.     end;
  439.   end;
  440.  
  441.   procedure CallTPC;
  442.   var I : Integer;
  443.   begin
  444.     with BE^ do begin
  445.       BW.Select;
  446.       ClrScr;
  447.       Report := '';
  448.       I := ExecDOSSwap(TPC_Command+' '+CmpFile,False,NIL,SwapFilePath);
  449.       if DOSExitCode <> 0 then begin
  450.         FindCompileError;
  451.         Select;
  452.         Draw;
  453.         if NFName <> CmpFile then
  454.           if NOT beLoad(NFName,False) then begin
  455.             GotError(epNonFatal+ecDeviceRead,'Couldn''t read '+NFName);
  456.             exit;
  457.           end;
  458.         beJumpToLine(LC);
  459.         beCursorHome;
  460.         beCursorRight(CC-1);
  461.       end
  462.       else begin
  463.         FindCompileGood;
  464.         Select;
  465.         Draw;
  466.       end;
  467.       DisplayMessage('  '+Report);
  468.     end;
  469.   end;
  470.  
  471.   procedure CallCompiler;
  472. {$IFDEF UseMouse}
  473.   var
  474.     B : Boolean;
  475. {$ENDIF}
  476.   begin
  477. {$IFDEF UseMouse}
  478.     if (MouseInstalled) then begin
  479.       HideMousePrim(B);
  480. {$IFDEF UseDrag}
  481.       RemoveISRs;
  482. {$ENDIF}
  483.     end;
  484. {$ENDIF}
  485.  
  486.       {NOTE: In case you're wondering why these two routines are broken apart,
  487.        it's because I lifted 'em from my older OpEditor-based program that
  488.        can call TCC, TASM and TD as well.}
  489.     CallTPC;
  490.  
  491. {$IFDEF UseMouse}
  492.     if (MouseInstalled) then begin
  493. {$IFDEF UseDrag}
  494.       InstallISRs;
  495. {$ENDIF}
  496.       with TTColors do
  497.         SoftMouseCursor($0000,(ColorMono(MouseColor,MouseMono) SHL 8) + $04);
  498.       ShowMousePrim(B);
  499.     end;
  500. {$ENDIF}
  501.   end;
  502.  
  503.   procedure PromptNewFile;
  504.   var TmpS : String;
  505.       B : Byte;
  506.       W : Word;
  507.       SSR : StreamStateRec;
  508.       P : FileNodePtr;
  509.   begin
  510.     with BE^ do begin
  511.       if LongFlagIsSet(beOptions,beModified) then begin
  512.         B := beYesNo(0, 'File modified.  Save it?', beYes, False);
  513.         if (B = beYes) and (Path <> '') then
  514.           if beStore(Path) then ;
  515.       end;
  516.       beSaveStreamState(SSR,True);
  517.       AddFileToList(FExpand(Path),SSR);
  518.       TmpS := Path;
  519.       if (beGetFileName(0,'New file: ',TmpS,False,False)) and
  520.          (StUpCase(TmpS) <> Path) then begin
  521.         TmpS := DefaultExtension(TmpS,beDefExt);
  522.         beInformation(0,'Working...');
  523.         if NOT beLoad(FExpand(TmpS),False) then begin
  524.           GotError(epFatal+ecDeviceRead,'Error loading new file');
  525.           SetLastCommand(ccError);
  526.         end
  527.         else begin
  528.           P := FindFileInList(Path);
  529.           if P = NIL then begin
  530.             beSaveStreamState(SSR,True);
  531.             AddFileToList(Path,SSR);
  532.           end
  533.           else beRestoreStreamState(P^.State,True);
  534.           ClearLongFlag(beOptions,beModified);
  535.         end;
  536.       end;
  537.       CmpFile := TmpS;
  538.       beForceRedraw := True;
  539.       beInformation(0,'');
  540.     end;
  541.   end;
  542.  
  543.   procedure Main;
  544.   begin
  545.       {init our screen-saver window}
  546.     BW.Init(1,1,ScreenWidth,ScreenHeight);
  547.       {init our BigEditor}
  548.     New(BE,InitCustom(2, 3, ScreenWidth-1, ScreenHeight-1, TTColors,
  549.                          DefWindowOptions or wBordered,
  550.                          DefBigEdOptions or beFastScrUpd or beHighlightOn));
  551.     if BE = NIL then
  552.       Abort('Error '+Long2Str(InitStatus)+' making BigEditor');
  553.  
  554.     with BE^ do begin
  555.         {fix up appearence items}
  556.       Dec(wXL);
  557.       with wFrame do begin
  558.         DefArrows := TriangleArrows;
  559.         AddCustomScrollBar(frRR,0,MaxLongInt,1,1,'■','░',TTColors);
  560.         AddCustomScrollBar(frBB,0,1023,0,1,'■','░',TTColors);
  561.       end;
  562.  
  563.         {set up our various procedure pointers}
  564.       beSetStatusProc(Status);
  565.       with BigEdCommands do begin
  566.         SetUserHookProc(UserHook);
  567.         AddCommand(ccAbandonFile, 1, $2D00, 0);  {AltX  Exit}
  568.         AddCommand(ccUser2,       1, $4300, 0);  {F9    Compile}
  569.         AddCommand(ccUser3,       1, $3D00, 0);  {F3    Load new}
  570.         AddCommand(ccSearch,      1, $3F00, 0);  {F5    Search}
  571.         AddCommand(ccReplace,     1, $4000, 0);  {F6    Search/Replace}
  572.       end;
  573.       beSetInfoProc(DisplayMessage);
  574.       beSetEditProc(EditProc);
  575.       beSetGetFileProc(GetFile);
  576.       beSetYesNoProc(YesNoFunc);
  577.       SetErrorProc(ErrorProc);
  578.       SetDefaultExtension('PAS');
  579.  
  580.         {draw the base window}
  581.       BW.Draw;
  582.       ClrScr;
  583.  
  584.         {draw the edit window before loading file}
  585.       BE^.Draw;
  586.  
  587.       if ParamCount = 0 then
  588.         Path := 'NOFILE.'
  589.       else begin
  590.         Path := StUpcase(ParamStr(1));
  591.         Path := DefaultExtension(Path,BE^.beDefExt);
  592.         if NOT beLoad(Path,False) then with BE^ do begin
  593.           Path := 'NOFILE.';
  594.           beNewLineList;
  595.           beResetLineList;
  596.         end;
  597.       end;
  598.       CmpFile := Path;
  599.       beSaveStreamState(State,True);
  600.       AddFileToList(FExpand(Path),State);
  601.  
  602.       ClearErrors;
  603.  
  604.       while True do begin
  605.         Process;
  606.         case GetLastCommand of
  607.           ccError :
  608.             begin
  609.               W := GetLastError;
  610.               ErrorProc(0,W,'');
  611.             end;
  612.  
  613.           ccAbandonFile :
  614.             if (NOT(beOptionsAreOn(beModified))) or
  615.                (YesNoFunc(0,'File modified.  Abandon changes?',beNo,False) = beYes) then begin
  616.               DisplayMessage('Working...');
  617.               Dispose(BE,Done);
  618.               BW.Erase;
  619.               BW.Done;
  620.               NormalCursor;
  621.               exit;
  622.             end;
  623.  
  624.           ccUser2 :
  625.             begin
  626.               if beOptionsAreOn(beModified) and (Path <> '') then begin
  627.                 if beStore(Path) then begin
  628.                   ClearLongFlag(beOptions,beModified);
  629.                   beSaveStreamState(State,True);
  630.                   AddFileToList(FExpand(Path),State);
  631.                 end;
  632.               end;
  633.               CallCompiler;
  634.               beForceRedraw := True;
  635.             end;
  636.  
  637.           ccUser3 :
  638.             PromptNewFile;
  639.  
  640.           else
  641.             ;
  642.         end;
  643.       end;
  644.     end;
  645.   end;
  646.  
  647. begin
  648.   FilesList.Init;
  649. end.
  650.  
  651.